Greetings!  Thanks for trying out Scrotok's Lootable Corpses 3.1!

I hope you'll find this script worthwhile.  I modified Keron Blackfeld's most excellent Lootable Corpses script -- he deserves 99% of the credit.  Thank you, Keron, for giving me permission to modify his awesome script!

Like Keron's 2.0, I think you'll find it is flexible enough to make most folks happy, and easy enough for even a novice to use.

Why did I do this?  Why not just use Sentur Signe's Lootable Corpses version 5.4?  The reason: I liked Keron's version better, and I still do.  Please let me know what YOU think!


OVERVIEW

This is an update to Keron Blackfeld's Lootable Corpses 2.0.

Allows you to configure creatures' deaths - allowing actual *lootable* corpses (as opposed to silly bags of loot) to never decay, or decay after certain parameters are met (which you can adjust).

Note that you MUST re-save (or press F7 for "Save and Compile") the "nw_c2_default7" script if you make any changes to "_kb_loot_corpse" (for programmers only: because it is an #include file).


FEATURES

Many of the features are obvious by examining the comments of the "_kb_loot_corpse" script.  Please let me know if you need more info.

Here are some of the many features:

1. The creature drops its weapon on the ground when they are slain.  The weapon does not appear in its inventory (unless you want it to).

2. Only the OnDeath script (nw_c2_default7) needs to be modified.  You don't need to modify the OnSpawn and OnUserDefined events, as other scripts might.

3. You can control how the corpse system works through a single script ("_kb_loot_corpse"), rather than having to edit the OnSpawn for every creature.

4. The lootable corpse placeable object is well-hidden, minimizing any chance for it to be seen.

5. The code is easy to read, and the total number of scripts is small.

6. Plot items are not destroyed (please let me know if you want this feature to be optional).

7. I used GetResRef and GetDroppableFlag to realize a huge increase in efficiency.  No more Nulspace and Grimm Collector.  Thanks BioWare!

8. A bloodspot appears under the corpse (unless it's undead), making for a visually appealing corpse.

9. You can choose whether or not dropped, unclaimed weapons are destroyed when the corpse is destroyed or fades.

10. A test module is included that explains the features in detail.


SUMMARY OF CHANGES

I called this version 3.X because the last version of the "_kb_loot_corpse" script which Keron made was 2.0.  The 3.X represents a "major overhaul."

Here's what I changed in version 3.1:

- You can choose whether unclaimed dropped weapons are destroyed when corpses fade or are destroyed.  Set "nKeepWeapons" to TRUE if you don't want dropped weapons to be destroyed.
- Removed a time delay which caused the armor to vanish from some corpses 1 second before the corpse itself vanished (if nCorpseFade > 0).
- In the "_kb_loot_corpse" script, I combined the "DestroyWeapons" and "ClearInventory" functions into one function called "DestroyInventory," to match the "DestroyInventory" function found in "_kb_destroy_cpse".  This has no impact on functionality.

Here's what I changed in version 3.0:

- Plot items are no longer destroyed.
- GetResRef and GetDroppableFlag are now incorporated.  This means the Grimm Collector (creature) and Nulspace (area) are no longer required.


FUTURE CHANGES:

Here's what I'm working on for the next version; I make no guarantees I'll succeed:

- Lootable corpse objects will not appear if the corpse has no items to loot (this makes it easier to find lootable corpses when the battlefield is littered with corpses).  Please note: nKeepEmpties is currently used to destroy empty lootable corpse objects, but the player must click the lootable object (to open its inventory) and close the inventory before the lootable is destroyed (to simulate the need to search a corpse to determine it has nothing on it).


CONTENTS OF THE ZIP FILE

Zip File size: 53.5KB.

The following ERF's are included in this ZIP file:

KB_Loot_Objs.erf (contains the custom placeable "invis_corpse_obj")
KB_Loot_Scripts.erf (contains 6 scripts)

Also in this ZIP file:
Lootable Corpses Test.mod (test module)
Scrotok's Lootable Corpses 3.1 Readme.txt (this file)

The file can be downloaded from NW Vault at this link:
http://nwvault.ign.com/Files/scripts/data/1039929913421.shtml


INSTALLATION INSTRUCTIONS:

(1) New users (Keron's Lootable Corpses 2.0 is NOT installed):

Import the ERFs into your module in no particular order - when prompted, always allow it to overwrite.  The only generic "stock" script that's affected is the "nw_c2_default7" script (this is the default OnDeath script).  This script has only 2 lines of code added to it - they are commented.  If you have already made changes to your existing version of that script, be sure to save it as another name BEFORE importing, so you can add your changes to mine, or even add mine to yours (mine are readily identifiable by the comments).

(2) Upgrading a module from Keron's 2.0 to Scrotok's 3.1:

Remove the "Nulspace" area.  Remove (and Confirm Delete when prompted) the "Grimm Collector" creature (found under "Paint Creatures" -> "Custom" -> "Special" -> "Custom 1").  Check the following scripts to ensure you didn't modify them with your own personal custom code:

_kb_destroy_cpse
_kb_loot_corpse
_kb_loot_crouch
_kb_ondist_loot
_kb_plc_corpse
nw_c2_default7 (be especially careful to check this one for your own code)

If needed, rename these scripts, so that your personal code won't be lost (you can add this code back later if desired).  Then import "KB_Loot_Scripts.erf," and allow it to overwrite.  There's no need to import "KB_Loot_Objs.erf", because the "invis_corpse_obj" custom placeable is already in your module.

(3) Upgrading a module from Scrotok's 3.0 to 3.1:

Check the following scripts to ensure you didn't modify them with your own personal custom code:

_kb_destroy_cpse
_kb_loot_corpse
_kb_loot_crouch
_kb_ondist_loot
_kb_plc_corpse
nw_c2_default7 (be especially careful to check this one for your own code)

If needed, rename these scripts, so that your personal code won't be lost (you can add this code back later if desired).  Then import "KB_Loot_Scripts.erf," and allow it to overwrite.  There's no need to import "KB_Loot_Objs.erf", because the "invis_corpse_obj" custom placeable is already in your module.


FREQUENTLY ASKED QUESTIONS

Q: Will this script cause monsters to drop items without checking the "Dropable" checkbox in the monster's inventory?

A: No, you must select the "Dropable" checkbox for each item you want to be dropped by the monster when it dies.

Q: I updated from Keron's 2.0, and my corpses don't fade any more!  What's the deal?

A: I changed the default value of "nCorpseFade" from 120 to 0 because I personally liked corpses that never fade.  You can change it back if desired.  Remember to re-save "nw_c2_default7" if you make any changes to "_kb_loot_corpse."


OTHER OPTIONS FOR LOOTABLE CORPSES

Sentur Signe's Lootable Corpses is another option available.  Please let me know which one YOU prefer, so I can strive to make this the best!

For a comparison of the two scripts, please see this link:
http://nwn.bioware.com/forums/viewtopic.html?topic=173112&forum=47

One of the main benefits of Sentur's script is the ability to customize the lootable corpse functionality for individual creatures.  If you like this ability to customize how the lootable corpses script works for individual creatures (as in Sentur's script), you can just make more than one version (instance) of "_kb_loot_corpse" and "nw_c2_default7", then change the #include line in the new version(s) of "nw_c2_default7" to "point" to the new version(s) of "_kb_loot_corpse."


FEEDBACK

If you have any questions or comments, please email me at jnbplatte@intellisys.net.

If you just want to thank Keron for doing 99% of this awesome script, please email him at Keron@BroadswordGaming.com.  Please don't email him for tech support -- he's out of the scripting business for now :)

Again, thanks for checking out this script!  I think it's the best, most completely customizable Lootable Corpses package out there.

Happy Gaming!
Scrotok
